/*
将函数 fn 的执行上下文改为 obj，返回 fn 执行后的值

输入：alterContext(function() {return this.greeting + ', ' + this.name + '!'; }, {name: 'Rebecca', greeting: 'Yo' })
输出：Yo, Rebecca!
*/

// 填写JavaScript
function alterContext(fn, obj) {
    return fn.call(obj)
}
console.log(alterContext(function () { return this.greeting + ', ' + this.name + '!'; }, { name: 'Rebecca', greeting: 'Yo' }))